package example.fuzzer;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.Properties;

/**
 * Author: Conor Craig 
 * 
 * Class loads ./conf/config into a java class.
 * */

// "http://127.0.0.1/dvwa/login.php";

public class BasicConfig extends Properties {

	/**
	 * Constructor takes the configuration file in the project directory and
	 * loads the key->values pairs into class variables.
	 * */
	public BasicConfig(File fileIn) {
		FileInputStream input;
		try {
			input = new FileInputStream(fileIn);
			this.load(input);
			for (String key : this.stringPropertyNames()) {
				String value = this.getProperty(key);
				System.out.println(key + " => " + value);
			}
		} catch (FileNotFoundException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
}
